<?php
namespace dwc_app;

session_start();
include_once('config.php');




$spreadsheet_tables_api = new GoogleSpreadsheetsAPI($GLOBALS['GOOGLE_USERNAME'], $GLOBALS['GOOGLE_PASSWORD'], @$_SESSION['GOOGLE_AUTH_TOKEN'], 'tdwgcodeblitz-dwc_spreadsheets-0.1');
$spreadsheet_tables_api->create_worksheet();

// session_start();
// include_once('config.php');
// include_once('GoogleFusionAPI.php');
// 
// $auth = null;
// if(isset($_SESSION['auth'])) $auth = $_SESSION['auth'];
// 
// 
// 
// 
// $fusion_tables_api = new GoogleFusionAPI($auth);
// $auth_token = $fusion_tables_api->login($GLOBALS['GOOGLE_USERNAME'], $GLOBALS['GOOGLE_PASSWORD']);
// if(!$auth_token)
// {
//     echo "Could not log in as user: ".$GLOBALS['GOOGLE_USERNAME'];
//     exit;
// }
// $_SESSION['auth'] = $auth_token;
// $auth = $_SESSION['auth'];
// 
// 
// print_r($fusion_tables_api->query('SHOW TABLES'));
// print_r($fusion_tables_api->create_table('DarwinCoreTest', array('taxonID' => 'NUMBER', 'scientificName' => 'STRING')));
// echo "<br><br>";
// print_r($fusion_tables_api->query('SHOW TABLES'));



?>